home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE04 / TIPTRIX / LISTING5.PAS next >
Encoding:
Pascal/Delphi Source File  |  1995-10-05  |  1.1 KB  |  38 lines

  1. Procedure TYourFormName.HideTitlebar;
  2. Var
  3.   Save : LongInt;
  4. Begin
  5.   If BorderStyle=bsNone then Exit;
  6.   Save:=GetWindowLong(Handle,gwl_Style);
  7.   If (Save and ws_Caption)=ws_Caption then Begin
  8.     Case BorderStyle of
  9.       bsSingle,
  10.       bsSizeable : SetWindowLong(Handle,gwl_Style,Save and
  11.         (Not(ws_Caption)) or ws_border);
  12.       bsDialog : SetWindowLong(Handle,gwl_Style,Save and
  13.         (Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
  14.     End;
  15.     Height:=Height-getSystemMetrics(sm_cyCaption);
  16.     Refresh;
  17.   End;
  18. end;
  19.  
  20. Procedure TYourFormName.ShowTitlebar;
  21. Var
  22.   Save : LongInt;
  23. begin
  24.   If BorderStyle=bsNone then Exit;
  25.   Save:=GetWindowLong(Handle,gwl_Style);
  26.   If (Save and ws_Caption)<>ws_Caption then Begin
  27.     Case BorderStyle of
  28.       bsSingle,
  29.       bsSizeable : SetWindowLong(Handle,gwl_Style,Save or ws_Caption or
  30.         ws_border);
  31.       bsDialog : SetWindowLong(Handle,gwl_Style,Save or ws_Caption or
  32.         ds_modalframe or ws_dlgframe);
  33.     End;
  34.     Height:=Height+getSystemMetrics(sm_cyCaption);
  35.     Refresh;
  36.   End;
  37. end;
  38.